package com.my.common.test;

import java.util.Date;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.my.common.util.ConstatFinalUtil;
import com.my.users.pojo.AUser;
import com.my.users.service.IUserService;

/**
 *
 * @author mayue
 *
 */
public class text 
{
	
	public IUserService userService;
	protected	ApplicationContext ac;
	//= new UserServiceImpl();

	@Before
	public void init()
	{
		ac = new ClassPathXmlApplicationContext("classpath:spring/applicationContext_*.xml");
		ConstatFinalUtil.LOGGER_SYSTEM.info("ac:{}",ac);
		this.userService = (IUserService) ac.getBean("userService");
		ConstatFinalUtil.LOGGER_SYSTEM.info("test---init()");
	}

	@Test
	public void testone()
	{
		ConstatFinalUtil.LOGGER_SYSTEM.info("test---testone()");
		AUser user = new AUser();
		user.setCreateTime(new Date());
		user.setEmail("333");
		user.setUpdateTime(new Date());
		user.setLastLoginTime(new Date());
		user.setPassword("123");
		user.setPhone("1111");
		user.setQq("321");
		user.setStatus(Byte.valueOf("0"));
		user.setTrueName("wqe");
		userService.insertAUserService(user);
		ConstatFinalUtil.LOGGER_SYSTEM.info("test---testone()");
	}

}
